package com.easy.component.network.callback;

import com.easy.component.ibase.EasyBaseActivity;
import com.easy.component.network.exception.ApiException;

import java.lang.ref.WeakReference;

/**
 * 描述: {描述}
 * 作者: jack-song
 * 创建日期: 2017/11/6 14:43
 * 修改日期: 2017/11/6
 * 版本: {版本}
 */
public class CallBackWrapper<T> extends CallBack<T> {
    private WeakReference<EasyBaseActivity> mWeakReference;

    public CallBackWrapper(EasyBaseActivity mActivity) {
        mWeakReference = new WeakReference<>(mActivity);
    }

    @Override
    public void onSuccess(T t) {
        if (mWeakReference.get() == null || mWeakReference.get().isFinishing()) {
            return;
        }
    }

    @Override
    public void onLoading(int progress) {

    }

    @Override
    public void onError(ApiException e) {
        if (mWeakReference.get() == null || mWeakReference.get().isFinishing()) {
            return;
        }
    }

    @Override
    public void onError() {

    }

    @Override
    public void onLoinError() {
        if (mWeakReference.get() == null || mWeakReference.get().isFinishing()) {
            return;
        }
    }
}
